package com.dbxt.clerk.service.Impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dbxt.clerk.service.ClerkService;
import com.dbxt.dao.ClerkRecordMapper;
import com.dbxt.dao.TeacherMapper;
import com.dbxt.entity.ClerkRecord;

@Service
@Transactional
public class ClerkServiceImpl implements ClerkService {
	@Resource
	private ClerkRecordMapper clerkRecordMapper;

	@Override
	public Boolean addRecord(ClerkRecord clerkRecord, Integer sid) {
		try {
			clerkRecordMapper.insertClerkRecord(clerkRecord, sid);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}

	@Override
	public ClerkRecord selectClerkRecord(Integer cid, Integer sid) {
		try {
			return clerkRecordMapper.selectByPrimaryKey(cid, sid);
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}
	}

	@Override
	public boolean updateContext(ClerkRecord clerkRecord) {
		// TODO Auto-generated method stub
		return clerkRecordMapper.updateContext(clerkRecord);
	}

	@Override
	public ClerkRecord selectContext(Integer rid) {
		// TODO Auto-generated method stub
		return clerkRecordMapper.selectContext(rid);
	}

	@Override
	public boolean insertContext(ClerkRecord clerkRecord) {
		// TODO Auto-generated method stub
		return clerkRecordMapper.insertContext(clerkRecord);
	}

	@Override
	public ClerkRecord selectCrid(Integer crid) {
		// TODO Auto-generated method stub
		return clerkRecordMapper.selectCrid(crid);
	}

	@Override
	public boolean updateCid(ClerkRecord clerkRecord) {
		// TODO Auto-generated method stub
		return clerkRecordMapper.updateCid(clerkRecord);
	}

}
